package com.foxwho.springbootunittesting.controller;

import com.foxwho.springbootunittesting.service.HiService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class HiController {
    @Autowired
    HiService hiService;

    @GetMapping("/hi/{name}")
    public String hello(@PathVariable("name") String name) {
        log.info("name={}", name);
        return hiService.hi(name);
    }
}
